<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.ptc.com/windchill/taglib/components"
	prefix="jca"%>
<%@ taglib uri="http://www.ptc.com/windchill/taglib/wrappers" prefix="w"%>
<%@page import="ext.tianma.upload.MyUtil"%>
<%@page import="java.util.ArrayList"%>
<!DOCTYPE HTML>
<%
String path = request.getContextPath();
String oid = request.getParameter("oid");
String wid = request.getParameter("wid");
String docKey = request.getParameter("docKey");
String conId = (String) request.getParameter("conId");
%>


<html>
<head>
<title>样品承认书上传</title>
<style type="text/css">
body, html{
     background:#ddecf5;
     width: 90%;
     height: 90%;
}  

#box1{
    background-color: white;
	height: 105%;
    width: 114%;
	padding-top: 4%;
	margin-top: 4%;
	margin-left: 3%;
}  

#box2{
   height: 100px; 
   position: absolute; 
   left: 45%; 
   top: 50%; 
   margin: -7% -29%; 
   padding-top: 8%;
}

#box3{
    text-align: center;
}
#submitButton{
    width: 90px;
	height: 30px;
	margin-top: 27%;
	margin-left: 93%;
}

</style>
</head>

<body>

   <script type="text/javascript">   
    self.resizeTo(650,520);   
    self.focus();   
   </script>

	<script type="text/javascript">
        function check() {
            var str = document.getElementById("fileName").value;
            var conId = document.getElementById("conId").value;
            if (conId=="" || "=请选择="==conId){
            	alert("请选择产品库！");
            }else if (str == "") {
                alert("请提交《样品承认书》文档！");
            } else {
                var url = '<%=path %>/netmarkets/jsp/upload/handleImportDoc.jsp?oid=<%=oid %>&wid=<%=wid %>&docKey=<%=docKey%>&conId='+conId;
                document.getElementById('uploadform').action = url;
                document.getElementById('uploadform').submit();
                document.getElementById("box2").innerText="正在导入，请稍候......";
                
            }

        }
       
    </script>


	<div id="box1">
	<form id="uploadform" method="POST" ENCTYPE="multipart/form-data">
		<div id="box2">
		
		  <span>选择样品承认书：</span>
		  <span><input id="fileName" name="fileName" size="30" type="file"
                        style=" height: 25px">
          </span>
			
			<div id="box3">
			     <input id="submitButton"
                        type="button" size="30" value="上传"
                        onclick="check()">
			</div>
		</div>

		<div class="form-group">

			<%
            ArrayList<String> ivals = null;
            ivals = MyUtil.getContainer();
            request.setAttribute("list", ivals);
        %>

			&nbsp;&nbsp;&nbsp;<font style="color: red; font-size: 14px;">*&nbsp;</font>选择产品库： <select id="conId" name="con">
				<option selected>=请选择=</option>
				<c:forEach var="con" items="${requestScope.list}">
					<option value="${con}">${con}</option>
				</c:forEach>
			</select>


		</div>
	</form>
	</div>
	
	
</body>
</html>